{extend name='admin@public/content'}

{block name="content"}
<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <div class="form-group">
        <label class="col-sm-2 control-label">奖品名称</label>
        <div class='col-sm-8'>
            {if !empty($vo.id)}
            <label class=" control-label">{$vo.goods_name}</label>
            {else/}
            <input autofocus name="goods_name" value='{$vo.goods_name|default=""}' required="required" title="请输入奖品名称" placeholder="请输入奖品名称" class="layui-input">
            {/if}
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label"></label>
        <div class='col-sm-8'>
            <div class="layui-inline ">
                <div class="layui-input-inline well">
                    <p class="color-desc label-required">奖品图片</p>
                    <input type="hidden" name="original_img" value="{$vo.original_img|default=''}">
                    <script>$('[name=original_img]').uploadOneImage()</script>
                </div>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">中奖提示</label>
        <div class='col-sm-8'>
            <input autofocus name="copywriter2" value='{$vo.copywriter2|default=""}' title="请输入中奖提示" placeholder="请输入中奖提示" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">中奖跳转链接</label>
        <div class='col-sm-8'>
            <input autofocus name="href" value='{$vo.href|default=""}' title="请输入中奖跳转链接" placeholder="请输入中奖跳转链接" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">中奖概率(%)</label>
        <div class='col-sm-8'>
            <input autofocus name="rate" value='{$vo.rate|default=0}' title="请输入中奖概率" placeholder="请输入中奖概率" class="layui-input">
        </div>
    </div>


    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <input type="hidden" name="type" value="{$type}">
            <button class="layui-btn" type="submit">保存配置</button>
            {if $Request.action eq 'add'}
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消编辑</button>
            {/if}
        </div>
    </div>

    <script>window.form.render();</script>

</form>
{/block}